<?php
/* 
 * Copyright (c) 2018-2021   All rights reserved.
 *
 * 创建时间：2021-10-09 20:07:32
 *
 * 项目：/levmodules  -  $  - AdminSettingsController.php
 *
 * 作者：{{AUTO GENERATE}}
 */

//此文件使用程序自动生成，下次生成时【不会】覆盖。
//在这里可以补充、完善你的程序逻辑

namespace modules\levmodules\controllers;

use Lev;
use lev\widgets\inputs\inputsWidget;
use modules\levmodules\controllers\_gen\BaseAdminSettings;

!defined('INLEV') && exit('Access Denied LEV');

class BaseAdminSettingsMiddle extends BaseAdminSettings
{

}

class AdminSettingsController extends BaseAdminSettingsMiddle
{

    public static $tmpPath = 'admin-settings';
    public static $trash   = true;//是否允许删除数据
    public static $addurl  = true;//是否显示创建数据按钮
    public static $copyOneBtn  = true;//复制一条数据

    public static $srhtitle    = '标题、输入框名';//模糊搜索字段名称
    //模糊搜索sql语句 例：name LIKE '%{srhkey}%'
    public static $srhkeyWhere = 'title LIKE \'%{srhkey}%\' OR inputname LIKE \'%{srhkey}%\'';

    public static $limit = 20;//每页显示多少条
    public static $order = ['id DESC'];//排序

    public static function showColumns() {
        //return parent::showColumns(); // TODO: Change the autogenerated stub
        return array(
                //'id'               => array('order' => null, 'name' => 'Id', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'displayorder'     => array('order' => null, 'name' => '排序', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'moduleidentifier' => array('order' => null, 'name' => '模块标识符', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'classify'         => array('order' => null, 'name' => '设置分类', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'title'            => array('order' => null, 'name' => '标题', 'thattr' => 'wd30 nowrap', 'merge' => ['inputname']),

                //'inputname'        => array('order' => null, 'name' => '输入框名', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'inputtype'        => array('order' => null, 'name' => '输入框类型', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'placeholder'      => array('order' => null, 'name' => '输入框内提示/默认值/设置', 'thattr' => '', 'merge' => ['inputvalue', 'settings']),

                //'inputvalue'       => array('order' => null, 'name' => '输入框值', 'thattr' => 'wd30 nowrap', 'merge' => []),

                //'settings'         => array('order' => null, 'name' => '通用设置', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'status'           => array('order' => null, 'name' => '表单分步', 'thattr' => 'wd30 nowrap', 'merge' => []),

                'uptime'           => array('order' => null, 'name' => '更新时间', 'thattr' => 'wd30 nowrap', 'merge' => []),

                //'addtime'          => array('order' => null, 'name' => '添加时间', 'thattr' => 'wd30 nowrap', 'merge' => []),

            );
    }

    public static function col_inputtype() {
        return inputsWidget::inputtype();
    }

    public static function setColumnShowtype()
    {
        //return parent::setColumnShowtype(); // TODO: Change the autogenerated stub
        return [
            'showtype' => [
                //从上往下先到先得
                'input_status'  => ['width'=>50],//显示为无刷新更改字段
                'input_inputtype'  => ['width'=>120],//显示为无刷新更改字段
                //'input_placeholder'  => ['width'=>120,'textarea'=>1],//显示为无刷新更改字段
                'srhkey_moduleidentifier' => 1,//['or'=>['{columnKey}']],//显示为点击可搜索字段
                'srhkey_classify' => 1,
                'status_{columnKey}' => 1,//显示为开关状态字段 status 自动
                'order_{columnKey}'  => 1,//显示为可排序输入框 含order关键字 自动
                'time_{columnKey}'   => 1,//显示为时间格式字段 含time关键字 自动
            ],
        ];
    }

    public static function formatListsv($sv, $lists)
    {
        return parent::formatListsv($sv, $lists); // TODO: Change the autogenerated stub
    }

    public static function formatUid($sv, $lists, $srhkey = ['uid'], $username0 = '')
    {
        return parent::formatUid($sv, $lists, $srhkey, $username0); // TODO: Change the autogenerated stub
    }

    public static function redirct($columnKey, $sv)
    {
        return parent::redirct($columnKey, $sv); // TODO: Change the autogenerated stub
    }

    public static function optButtons($sv)
    {
        return parent::optButtons($sv); // TODO: Change the autogenerated stub
    }

    public static function headerHtm()
    {
        return parent::headerHtm(); // TODO: Change the autogenerated stub
    }

    public static function footerHtm()
    {
        return parent::footerHtm(); // TODO: Change the autogenerated stub
    }

    public static function footerBtns($btns = [])
    {
        return parent::footerBtns($btns); // TODO: Change the autogenerated stub
    }

    public static function cardFooterButtons($btns = [])
    {
        return parent::cardFooterButtons($btns); // TODO: Change the autogenerated stub
    }
}